package com.moon.consumer01;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class IndexApiHystrix implements FallbackFactory {
    @Override
    public IndexApi create(Throwable throwable) {

        IndexApi indexApiHystrix  =  new IndexApi() {
           @Override
           public String index() {
               System.out.println("服务降级调用index方法");
               return "服务降级调用index方法";
           }
       };
        return indexApiHystrix ;
    }
}
